//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_creategroup.sqf"
#include "x_setup.sqf"

private ["_grp","_side","_side_str"];
PARAMS_1(_side);
_side_str = if (typeName _side == "SIDE") then {
	_side
} else {
	if (typeName _side == "STRING") then {
		_side call FUNC(StoreGet)
	} else {
		if (typeName _side == "OBJECT") then {
			side _side
		} else {
			_side
		};
	};
};
_grp = createGroup _side_str;
// GVAR(gstate)
// 0 = created
// 1 = filled with units
// 2 = reduced
[_grp, 0] call FUNC(setGState);
#ifdef __GROUPDEBUG__
if (isNil QGVAR(all_marker_groups)) then {
	GVAR(all_marker_groups) = [];
	0 spawn FUNC(map_group_count_marker);
};
[_grp] spawn FUNC(groupmarker);
#endif
__TRACE_1("creategroup","_grp")
_grp